package cn.itcast.com.Generic;

import lombok.Data;

import java.util.ArrayList;

public class demo {
    public static void main(String[] args) {
        GenericType<Integer> integerGenericType = new GenericType<Integer>(1);
        GenericType<Float> integerGenericType2 = new GenericType<Float>(1.0f);
        ArrayList<Integer> integers = new ArrayList<>();

    }
}

@Data
class GenericType<T>{
    T x;

    public GenericType(T x) {
        this.x = x;
    }

    public String printstr(T x){
        return "Generictypr="+x;
    }
}
